import React from 'react'
import './style.css'

class Modal extends React.PureComponent {
  render() {
    const { show, children, close } = this.props
    return (
      <div style={{ display: show ? 'block' : 'none' }}>
        <div className="dialog">
          <div className="content">
            <h3 className='top'>
              <span onClick={() => close()}>X</span>
            </h3>
            <div>
              { children }
            </div>
          </div>
        </div>
      </div>  
    )
  }
}

export default Modal